﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227

namespace QuizHackathon
{
    /// <summary>
    /// Provides application-specific behavior to supplement the default Application class.
    /// </summary>
    sealed partial class App : Application
    {
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        /// 
        public string[] bonusQuestions;
        public string[] easyMathQuestions;
        public string[] easyEnglishQuestions;
        public string[] easyProblemQuestions;
        public string[] mediumMathQuestions;
        public string[] mediumEnglishQuestions;
        public string[] mediumProblemQuestions;
        public string[] difficultMathQuestions;
        public string[] difficultEnglishQuestions;
        public string[] difficultProblemQuestions;
        public bool[] bonusAnswers;
        public string[,] englishAnswers;
        public string[] difficultEnglishAnswers;
       public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            
            
            
            easyProblemQuestions = new string[5];
            
            
            mediumProblemQuestions = new string[5];
            difficultEnglishQuestions = new string[5];
            
            difficultProblemQuestions = new string[5];
            
           
            initializeQuestions();
        }
       public void initializeQuestions()
       {
           bonusQuestions = new string[20] { 
               "Tomato is a fruit",
               "Platypus is a mammal",
               "Latin was spoken in ancient Mayan and Inca culture ",
               "Samurais are from Korea",
               "Tarantula is a wasp. Non poisonous though",
               "Potatoes were discovered in China in 23 BC",
               "Julius Caesar, the Turkish General ruled Egypt",
               "Blankets don't make you warm. Its your body heat that gets trapped inside",
               "There is no land on North Pole",
               "You can see brilliant color waves as shown below near polar areas",
               "Nikola Tesla was an electricity genius",
               "Crocodiles are capable of asexual reproduction",
               "In Italy, you cannot keep a fish in a fish bowl",
               "Ant can lift 10 times weight than its own",
               "Cockroaches can survive upto 3 years with their head chopped off!!",
               "Australia is the flattest continent",
               "South Africa had 3 capitals and 5 flags once upon a time",
               "Kiwi is both a fruit and a bird",
               "Apple is not a fruit",
               "Chinese is a language"
           };
           bonusAnswers = new bool[20] {
               true, true, false, false, false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, false
           };

           easyEnglishQuestions = new string[5] {
               "'An' comes before?",
               "A Himalayas are young mountains- Any corrections?",
               "Apple the day keeps a doctor away- Is this right?",
               "Which of them is not a noun?",
               "Verbs are the- "               
           };
           mediumEnglishQuestions = new string[5] {
               "You, him and I are going to the movie",
               "He and me are coming from New Delhi",
               "Since I am not coming, he is not coming too",
               "You didn't do this, didn't you?",
               "Where are your childrens?"
           };
           difficultEnglishQuestions = new string[5] {
               "The Taj Mahal Monument ___ (build) in honor of Mumtaz Mahal, the wife of Mughal emporer Shah Jahan.",
               "Abraham Lincoln's famous speeches ___ (engrave) on the interior walls of the Lincoln Memorial.",
               "The government ___ (dedicate) to protect the rights of all its citizens.",
               "Do you know that New Delhi, the capital of the Democratic Republic of India, ___ (head) by a mayor?",
               "If you visit the Pyramids, you will see a giant statue of Sphinx ___ (dominate) the background."
           };
           englishAnswers = new string[10,4] {
               {"vowels", "consonants", "integers", "nouns" },
               {"The Himalayas", "its correct", "An Himalayas","Himalayas are pretty old"},
               {"Apple a day keeps the doctor away", "Crocin a day keeps the doctor away", "its correct", "Nothing can keep the doctor away"},
               {"drinking", "Henry", "boy", "Banana"},
               {"doing words", "working nouns", "democracy", "alphabetically sorted nouns"},
               {"Him, you and I", "its correct", "You, him and me", "You and me"},
               {"He and I", "Him and me", "its correct", "I and he"},
               {"therefore he is not coming too", "hence, he is not coming either", "its correct", "As I am not going to come"},
               {"did you?", "did you not?", "no correction", "potatoes and bananas"},
               {"children", "no correction", "babies", "kid"}
           };
           difficultEnglishAnswers = new string[5] {
               "was built", "are engraved", "is dedicated", "is headed", "dominating" 
           };
       }
       /// <summary>
       /// Invoked when the application is launched normally by the end user.  Other entry points
       /// will be used when the application is launched to open a specific file, to display
       /// search results, and so forth.
       /// </summary>
       /// <param name="args">Details about the launch request and process.</param>
       protected override void OnLaunched(LaunchActivatedEventArgs args)
        {
            if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
            {
                //TODO: Load state from previously suspended application
            }

            // Create a Frame to act navigation context and navigate to the first page
            var rootFrame = new Frame();
            rootFrame.Navigate(typeof(BlankPage));

            // Place the frame in the current Window and ensure that it is active
            Window.Current.Content = rootFrame;
            Window.Current.Activate();
        }

        /// <summary>
        /// Invoked when application execution is being suspended.  Application state is saved
        /// without knowing whether the application will be terminated or resumed with the contents
        /// of memory still intact.
        /// </summary>
        /// <param name="sender">The source of the suspend request.</param>
        /// <param name="e">Details about the suspend request.</param>
        void OnSuspending(object sender, SuspendingEventArgs e)
        {
            //TODO: Save application state and stop any background activity
        }
    }
}
